package com.example.crm.service.impl;

import com.example.crm.entity.Account;
import com.example.crm.service.AccountManager;
import com.example.crm.service.AccountService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.Assert;

import javax.annotation.Resource;

@Service
@Slf4j
@Transactional
public class AccountServiceImpl implements AccountService {

    @Resource
    private AccountManager baseManager;

    @Override
    public Account selectAccount(String userName) {
        Assert.notNull(userName, "userName不能为空");
        return baseManager.getByUsername(userName);
    }
}
